import java.util.Scanner;

public class Demo04_Score {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int diff =0;
        int html =0;
        int sql =0;
        
        System.out.println("请输入 Java 程序逻辑基础的成绩:");
        int java = input.nextInt();

        System.out.println("请输入数据库课程的成绩：");
         sql = input.nextInt();

         System.out.println("请输入 HTML 课程的成绩：");
         html = input.nextInt();
        System.out.println("----------------------");
        System.out.println(("JAVA      HTML      SQL"));
        System.out.println(java+"      "+html+"      "+sql);
        System.out.println("----------------------");
        diff = java - sql;
        
        System.out.println("Java 课程和数据库课程的成绩差：" + diff);

        double avg = (java + html + sql) / 3.0; // Ensure division is floating - point division
        System.out.println("3门课程的平均分是：" + avg);

        input.close(); // 关闭Scanner对象
    }
}
